<template>
  <!-- 工单信息 -->
  <el-form
    :inline="true"
    ref="formData"
    :model="formData"
    :rules="rules"
    label-width="100px"
    label-position="right"
  >
    <el-row>
      <el-col :span="12">工单信息</el-col>
    </el-row>
    <el-divider content-position="center"></el-divider>
    <el-row>
      <el-col :span="12">
        <el-form-item
          label="工单备注:"
          prop="remark"
        >
          <el-input
            type="textarea"
            clearable
            v-model="formData.remark"
            :autosize="{ minRows: 2, maxRows: 4}"
            class="w-200"
          />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item
          label="单据日期:"
          prop="receiptsTime"
        >
          <el-date-picker
            v-model="formData.receiptsTime"
            disabled
            type="date"
            style="width: 195px"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择"
          ></el-date-picker>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>
import moment from 'moment'
import {objectAssignment} from '@/utils/index'
export default {
  props: {
    formValue: {
      type: Object,
      default: () => { return {} },
    },
    workOrderType: {
      type: Number,
      default: 1,//1 快速单 2 综合单
    }
  },
  data () {
    return {
      formData: {
        remark: '',//工单备注
        receiptsTime: '',
      },
      rules: {},
    }
  },
  watch: {
    formValue: {
      deep: true,
      handler (newValue, oldValue) {
        this.formData = objectAssignment(this.formData, {
          ...newValue,
        });
      },
    },
  },
  async created () {
    // this.$set(this.formData, 'receiptsTime', moment(new Date()).format('YYYY-MM-DD HH:mm:ss'))
  }
}
</script>
